package com.business.bean.system;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;
import net.sf.rose.jdbc.bean.ModelBean;
import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;
import net.sf.rose.jdbc.bean.annotation.View;

/**
 * @author fengjian E-mail: 9110530@qq.com
 * @version 创建时间：2018年7月1日 类说明 ：用户信息表
 */
@Setter
@Getter
@Table(name = "SYS_USER", description = "用户信息表")
@View(name = "SYS_USER_VIEW", description = "用户信息表")
public class UserBean extends ModelBean {

	@Column(pk = true, type = Type.定长文本, description = "用户编号", canNull = false, size = 32, policy = "UUID")
	private String userID = null;

	@Column(type = Type.变长文本, description = "用户姓名", size = 50)
	private String userName = null;

	@Column(type = Type.变长文本, description = "登录名", size = 50)
	private String loginName;

	@Column(type = Type.变长文本, description = "登录密码", size = 50)
	private String loginPassword;

	@Column(type = Type.变长文本, description = "手机号码", size = 50)
	private String mobile = null;

	@Column(type = Type.定长文本, description = "部门编号", size = 32)
	private String departID = null;

	@Column(type = Type.变长文本, description = "部门名称", size = 100)
	private transient String departName = null;

	@Column(type = Type.定长文本, description = "领导编号", size = 32)
	private String leaderID = null;

	@Column(type = Type.变长文本, description = "领导姓名", size = 50)
	private transient String leaderName = null;

	@Column(type = Type.变长文本, description = "身份证号", size = 100)
	private String idCard = null;

	@Column(type = Type.变长文本, description = "工号", size = 10)
	private String workNo = null;

	@Column(type = Type.定长文本, description = "工种编号", size = 32)
	private String jobID = null;

	public static int PROJECT_WOKER_YES = 1;
	public static int PROJECT_WOKER_NO = 2;

	/** 1：是；2：否 */
	@Column(type = Type.数字整型, description = "项目人员")
	private int projectWoker = 2;

	@Column(type = Type.日期时间, description = "入职日期")
	private Date enterTime = null;

	@Column(type = Type.日期时间, description = "离职日期")
	private Date leaveTime = null;

	@Column(type = Type.变长文本, description = "职务名称", size = 50)
	private String postName = null;

	@Column(type = Type.变长文本, description = "角色编号", size = 32)
	private String roleID;

	@Column(type = Type.变长文本, description = "角色名称", size = 50)
	private transient String roleName;

	@Column(type = Type.变长文本, description = "邮件", size = 50)
	private String email;

	/** 性别，1.男。2.女 */
	@Column(type = Type.数字整型, description = "用户性别")
	private int sex;

	@Column(type = Type.日期时间, description = "用户生日")
	private Date birthday;

	@Column(type = Type.变长文本, description = "详细地址")
	private String address;

	@Column(type = Type.数字整型, description = "学历")
	private int education;

	/** 1:在职；2:离职 */
	@Column(type = Type.数字整型, description = "状态", canNull = true)
	private int status;

	@Column(type = Type.数字整型, description = "登录次数", canNull = true)
	private int loginCount;

	@Column(type = Type.日期时间, description = "上次登录时间")
	private Date lastLoginTime = null;

	@Column(type = Type.变长文本, description = "城市", size = 50)
	private String city;

	@Column(type = Type.变长文本, description = "省份", size = 50)
	private String province;

	@Column(type = Type.变长文本, description = "国家", size = 50)
	private String country;

	@Column(type = Type.变长文本, description = "openid", size = 50)
	private String openId;

	@Column(type = Type.变长文本, description = "建行帐号", size = 50)
	private String ccbAccount;

	@Column(type = Type.变长文本, description = "交行帐号", size = 50)
	private String bccAccount;

	@Column(type = Type.变长文本, description = "公积金帐号", size = 50)
	private String fundAccount;

	@Column(type = Type.数字整型, description = "公积金状态")
	private int fundState;

	@Column(type = Type.变长文本, description = "异常联系电话", size = 20)
	private String abnormalTel;

	@Column(type = Type.变长文本, description = "备注", size = 250)
	private String remark;

	/** 0:没有请假;1:上午请假;2:下午请假;3:全天请假;4:多天 */
	@Column(type = Type.数字整型, description = "请假类别")
	private int applyType = 0;

	@Override
	public String toString() {
		return this.loginName == null ? super.toString() : this.loginName;
	}
}
